﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Collections.ObjectModel;
using System.Text.RegularExpressions;

namespace PatientInformationExtract.MainInterface.Models
{
    public class ExportListTreeItem : INotifyPropertyChanged
    {
        public ExportListTreeItem(string folderPath)
        {
            this.FolderPath = folderPath;
            Regex regex = new Regex(@"\\([^\\]*)$");
            this.Name = regex.Match(folderPath).Groups[1].ToString();
        }

        private bool _isChecked;
        public bool IsChecked
        {
            get
            { return this._isChecked; }
            set
            {
                this._isChecked = value;
                NotifyPropertyChanged("IsChecked");
            }
        }

        public string FolderPath { get; set; }

        private string _name;
        public string Name
        {
            get
            { return this._name; }
            set
            {
                this._name = value;
                NotifyPropertyChanged("Name");
            }
        }

        #region INotifyPropertyChanged
        public event PropertyChangedEventHandler PropertyChanged;

        public void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }
        #endregion
    }
}
